import * types from '../actionTypes';

const initState = {
  code:0,
  message:'',
  data:'',
  isFetching:false,
  DateTime:null
}

export default (state = initState, action)=> {
  switch (action.type) {
    case types.USER_REQUEST:
      return {
        ...state,
        isFetching:true
      }
    case types.USER_SUCCESS:
      return {
        ...state,
        ...action.data,
        isFetching:false,
      }
    case types.USER_REQUEST:
      return {
        ...state,
        isFetching:true
      }
    default:
      state
  }
}